package study.kits.excel.easyexcel.support.utils;

import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.data.CellData;

public class CellUtils {

    public static String getCellData(CellData data) {
        String value = null;
        CellDataTypeEnum type = data.getType();
        if (type == null) {
            type = CellDataTypeEnum.EMPTY;
        }
        //
        switch (type) {
            case STRING:
                value = data.getStringValue();
                break;
            case NUMBER:
                value = data.getNumberValue().toString();
                break;
            case BOOLEAN:
                break;
            default:
        }
        return value;
    }
}
